extends "../chicheng-3/chicheng-3.gd"


var baseId = ""
var upText1 = "命运五分钟时间阈值延长到30秒"
var upText2 = "奇袭额外赋予3层<灼烧>"
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("战斗前20秒，自身舰载机获得50%增伤与30%减伤，20秒之后获得50%伤害惩罚", "命运五分钟")

var p4 = 20
func upgrade():
	.upgrade()
	if upgraded == 1:
		p3 = 6
	if upgraded == 2:
		p4 = 30

func castPlane():
	var cha = .castPlane()
	if cha != null:
		if battleTime < p4:
			cha.addBuff(b_chicheng.new(p4 - battleTime))
		else:
			cha.addBuff(b_chicheng2.new())

class b_chicheng:
	extends "../../../azurlane_ctrl/AzurBuff.gd"
	func _init(lv = 1):
		attInit()
		id = "b_chicheng"
		buffName = "命运五分钟"
		dispel = 2
		att.atkR = 0.5
		life = lv
	func _connect():
		masCha.connect("onHurt",self,"onHurt")
	func onHurt(atkInfo):
		atkInfo.hurtVal *= 0.7

class b_chicheng2:
	extends "../../../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		id = "b_chicheng2"
		buffName = "命运五分钟-负面"
		dispel = 2
		att.atkR = -0.5